All Packages Class Hierarchy This Package Previous Next Index
Class quicktime.app.QTFactory
java.lang.Object
|
+----quicktime.app.QTFactory
- public final class QTFactory
- extends Object
The QTFactory class provides factory methods for creating classes that are used
to present media that QuickTime can import. It also provides some utility methods
for finding directories and files in the local file system.
An example usage of some of the factory methods:
File mediaFile = QTFactory.findAbsolutePath ("media/myMovie.mov");
QTDrawable d = QTFactory.makeDrawable(new QTFile(mediaFile));
myQTCanvas.setClient (d);
...
// from an URL
QTDrawable d2 = QTFactory.makeDrawable ("http://web.mywebsite.com/movies/myMovie.mov");
myOtherQTCanvas.setClient (d2);
-
addDirectory(File)
- This method will add a directory to the internal list of directories that are searched in
the find methods.
-
findAbsolutePath(String)
- Given a filename this method will exhaustively search all paths found in the user.dir and the classPath and
will return a file object that contains an absolute path to the specified argument.
-
findInSystemPaths(String)
- This method will take apart the path specification of the fileName and return the
first instance of the file (the last name in the path) that it finds within the
directories that are known to Java at runtime.
-
makeDrawable(InputStream, int, String)
- This returns a QTDrawable object from the specified input stream.
-
makeDrawable(InputStream, int, String, QTDrawableMaker)
- This returns a QTDrawable object from the specified input stream.
-
makeDrawable(QTFile)
- This returns a QTDrawable object from the specified file.
-
makeDrawable(QTFile, QTDrawableMaker)
- This returns a QTDrawable object from the specified file.
-
makeDrawable(String)
- This returns a QTDrawable object from the specified URL.
-
makeDrawable(String, QTDrawableMaker)
- This returns a QTDrawable object from the specified Universal Resource Locator.
-
removeDirectory(File)
- This method will remove a directory from the internal list of directories that are searched in
the find methods.
findInSystemPaths
public static File findInSystemPaths(String fileName) throws IOException
- This method will take apart the path specification of the fileName and return the
first instance of the file (the last name in the path) that it finds within the
directories that are known to Java at runtime.
- Parameters:
- path - a path specification that should be found somewhere in the system paths
- Throws: SecurityException
- will be returned if the Applet is not allowed access to the class path
system property. Typically this is the case - you should use the codeBase or documentBase paths of the
applet to position and locate files at run time.
- Throws: IOException
- the file cannot be found in any of the class path locations.
addDirectory
public static void addDirectory(File dir) throws IOException
- This method will add a directory to the internal list of directories that are searched in
the find methods. The incoming File object must specify a directory that exists or an IOException
will be thrown. If the directory is already a member of the list it will not be added.
Directories that are added explicitly will be searched first in the find calls.
- Parameters:
- dir - a directory
removeDirectory
public static void removeDirectory(File dir) throws IOException
- This method will remove a directory from the internal list of directories that are searched in
the find methods.
- Parameters:
- dir - a directory
findAbsolutePath
public static File findAbsolutePath(String fileName) throws IOException
- Given a filename this method will exhaustively search all paths found in the user.dir and the classPath and
will return a file object that contains an absolute path to the specified argument.
- Parameters:
- fileName - the file to search for.
- Returns:
- a file object that represents the absolute path to the specified path.
- Throws: SecurityException
- will be returned if the Applet is not allowed access to the class path
system property. Typically this is the case - you should use the codeBase or documentBase paths of the
applet to position and locate files at run time.
- Throws: IOException
- the file cannot be found in any of the class path locations.
makeDrawable
public static QTDrawable makeDrawable(QTFile qtFile) throws IOException, QTException
- This returns a QTDrawable object from the specified file. The file must specify an absolute path.
It uses the default QTDrawableMaker to return an GraphicsImporterDrawer object from a GraphicsImporter and a
QTPlayer from a Movie.
- Parameters:
- file - the file to make a movie out of
- Returns:
- a drawable object that can present the QT File
- Throws: StdQTException
- If the file is of a format that is not understood by QuickTime
the function will throw a StdQTException with error code invalidMovie.
- Throws: IOException
- is thrown if the file would violate security settings of an applet
- See Also:
- GraphicsImporterDrawer, QTPlayer, QTDrawableMaker
makeDrawable
public static QTDrawable makeDrawable(QTFile qtFile,
QTDrawableMaker maker) throws IOException, QTException
- This returns a QTDrawable object from the specified file. The file must specify an absolute path.
It uses the supplied QTDrawableMaker to return objects from a GraphicsImporter or
a Movie.
- Parameters:
- file - the file to make a movie out of
- maker - specifies which type of QTDrawable object is returned when the factory imports a
Graphics or Movie based media.
- Returns:
- a drawable object that can present the QT File
- Throws: StdQTException
- If the file is of a format that is not understood by QuickTime
the function will throw a StdQTException with error code invalidMovie.
- Throws: IOException
- if the file is not found
- See Also:
- GraphicsImporterDrawer, QTPlayer, QTDrawableMaker
makeDrawable
public static QTDrawable makeDrawable(InputStream is,
int hintType,
String hintString) throws IOException, QTException
- This returns a QTDrawable object from the specified input stream.
The input stream will be read in its entirety to a byte array which is then used as the
source of the data to import. The hints are used by the importers to determine
the format of the data contained within the input stream. Hints must be given to
QuickTime about the format of the data
that is contained within the InputStream. Hints can take one of three forms
- MIME Type -> kDataRefMimeTypeTag
- MacOS File Type -> kDataRefQTFileTypeTag
- File extension -> kDataRefFileExtensionTag
The preferred usage is to pass in either the MacOS File Type (which will also work on non-MacOS platforms)
or the MIME type information. The File extension is a more arbitrary indicator and should be the least
referred to. It uses the default QTDrawableMaker to return objects from a GraphicsImporter or
a Movie.
- Parameters:
- is - the input stream from which the bytes will be read
- hintFlag - describes the hint data that is used
- hintString - contains the hint information
- Returns:
- a drawable object that can present the QT File
- Throws: StdQTException
- If the data is of a format that is not understood by QuickTime
the function will throw a StdQTException with error code invalidMovie.
- Throws: IOException
- is thrown if the input stream is unable to aquire all the data
- See Also:
- GraphicsImporterDrawer, QTPlayer, QTDrawableMaker
makeDrawable
public static QTDrawable makeDrawable(InputStream is,
int hintType,
String hintString,
QTDrawableMaker maker) throws IOException, QTException
- This returns a QTDrawable object from the specified input stream.
The input stream will be read in its entirety to a byte array which is then used as the
source of the data to import. The hints are used by the importers to determine
the format of the data contained within the input stream. Hints must be given to
QuickTime about the format of the data
that is contained within the InputStream. Hints can take one of three forms
- MIME Type -> kDataRefMimeTypeTag
- MacOS File Type -> kDataRefQTFileTypeTag
- File extension -> kDataRefFileExtensionTag
The preferred usage is to pass in either the MacOS File Type (which will also work on non-MacOS platforms)
or the MIME type information. The File extension is a more arbitrary indicator and should be the least
referred to. It uses the default QTDrawableMaker to return objects from a GraphicsImporter or
a Movie.
- Parameters:
- hintFlag - describes the hint data that is used
- hintString - contains the hint information
- maker - specifies which type of QTDrawable object is returned when the factory imports a
Graphics or Movie based media.
- Returns:
- a drawable object that can present the QT File
- Throws: StdQTException
- If the data is of a format that is not understood by QuickTime
the function will throw a StdQTException with error code invalidMovie.
- Throws: IOException
- is thrown if the input stream is unable to aquire all the data
- See Also:
- GraphicsImporterDrawer, QTPlayer, QTDrawableMaker
makeDrawable
public static QTDrawable makeDrawable(String url) throws QTException
- This returns a QTDrawable object from the specified URL.
It uses the default QTDrawableMaker to return an GraphicsImporterDrawer from a GraphicsImporter or
a QTPlayer from a Movie.
- Parameters:
- url - specifies the URL to the QT source media
- Returns:
- a drawable object that can present a QT media
- Throws: StdQTException
- If the file is of a format that is not understood by QuickTime
the function will throw a StdQTException with error code invalidMovie.
- Throws: SecurityException
- is thrown if the file would violate security settings of an applet
makeDrawable
public static QTDrawable makeDrawable(String url,
QTDrawableMaker maker) throws QTException
- This returns a QTDrawable object from the specified Universal Resource Locator.
It uses the supplied QTDrawableMaker to return objects from a GraphicsImporter or
a Movie.
- Parameters:
- url - is the fully qualified url to the QuickTime media.
- maker - specifies which type of QTDrawable object is returned when the factory imports a
Graphics or Movie based media.
- Returns:
- a drawable object that can present the QT File
- Throws: StdQTException
- If the file is of a format that is not understood by QuickTime
the function will throw a StdQTException with error code invalidMovie.
- Throws: SecurityException
- is thrown if the file would violate security settings of an applet
- See Also:
- GraphicsImporterDrawer, QTPlayer, QTDrawableMaker
All Packages Class Hierarchy This Package Previous Next Index